﻿@using System.Data;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@{
   DTcms.Model.sites site = ViewData["site"] as DTcms.Model.sites;
   DTcms.Model.sysconfig config = ViewData["sysConfig"] as DTcms.Model.sysconfig;
   Layout = "~/Areas/Web/Views/" + site.build_path + "/Shared/_LayoutShow.cshtml";
    ViewBag.Title = "友情链接 + " + site.name;
    BaseController bc = ViewBag.BasePage as BaseController;
    LinkController c = ViewBag.This as LinkController;
    DataTable list = ViewData["list"] as DataTable;
    int page = int.Parse(ViewBag.Page as string);
    int totalcount = 0;
    DataTable contentlist = bc.get_article_list("content", 0, 0, "status=0");
    DataTable imgList = c.get_link_list(0, "is_image=1");
    DataTable txtList = c.get_link_list(0, "is_image=0");
}
@section HeaderContent{
   <script src="~/Scripts/jquery/jquery.form.min.js"></script>
}
@section Scripts{
   <script>
      $(function () {
         //初始化表单
         AjaxInitForm('#link_form', '#btnSubmit', 1);
      });
   </script>
}
<div class="section clearfix">
  <!--右边-->
  <div class="list-right">
    <div class="sidebar-box">
      <div class="line30"></div>
      <h3>栏目导航</h3>
      <ul class="navbar">
        @foreach(DataRow dr in contentlist.Rows){
        <li>
          <h4><a title="@dr["title"]" href="@bc.linkurl("content",dr["call_index"])">@dr["title"]</a></h4>
        </li>
        }
        <li>
          <h4><a href="@bc.linkurl("feedback")">留言反馈</a></h4>
        </li>
        <li>
          <h4><a href="@bc.linkurl("link")">友情链接</a></h4>
        </li>
      </ul>
      <div class="line20"></div>
      <h3>客户服务</h3>
      <div class="sidebar-txt">
        <p><strong>@site.company</strong></p>
        <p>地址：@site.address</p>
        <p>电话：@site.tel</p>
        <p>E-mail：@site.email</p>
        <p>新浪微博：http://weibo.com/dtcms</p>
      </div>
    </div>
  </div>
  <!--/右边-->
  
  <!--左边-->
  <div class="list-auto">
    <div class="ntitle">
      <h2>
        <a>友情链接</a>
      </h2>
    </div>
    
    <div class="line15"></div>
    <!--链接列表-->
    <div class="links">
      <ul class="img">
        @foreach(DataRow dr in imgList.Rows){
        <li>
          <a target="_blank" href="@dr["site_url"]" title="@dr["title"]">
            <img src="@dr["img_url"]" />
          </a>
        </li>
        }
      </ul>
      <div class="line15"></div>
      <ul class="txt">
        <li>
        @foreach(DataRow dr in txtList.Rows){
        <a target="_blank" href="@dr["site_url"]" title="@dr["title"]">@dr["title"]</a> <span>|</span>
        }
        </li>
      </ul>
    </div>
    <!--/链接列表-->
    <div class="line20"></div>
    
    <!--申请链接-->
    <h2 class="base-tit">
      <span>申请链接<a name="Add" id="Add"></a></span>
    </h2>
    <div class="line10"></div>
    <form id="link_form" name="link_form" url="@(config.webpath)plugins/link/ajax.ashx?action=add&site=@site.id">
    <div class="form-box" style="border:0;">
      <dl>
        <dt>网站名称：</dt>
        <dd>
          <input id="txtTitle" name="txtTitle" type="text" class="input txt" datatype="*" sucmsg=" " />
          <span class="Validform_checktip">*需要申请友情链接的网站标题</span>
        </dd>
      </dl>
      <dl>
        <dt>联系人：</dt>
        <dd>
          <input id="txtUserName" name="txtUserName" type="text" class="input txt" datatype="*" sucmsg=" " />
          <span class="Validform_checktip">*该网站联系人的姓名</span>
        </dd>
      </dl>
      <dl>
        <dt>联系电话：</dt>
        <dd>
          <input id="txtUserTel" name="txtUserTel" type="text" class="input txt" />
        </dd>
      </dl>
      <dl>
        <dt>电子邮箱：</dt>
        <dd>
          <input id="txtEmail" name="txtEmail" type="text" class="input txt" />
        </dd>
      </dl>
      <dl>
        <dt>链接网址：</dt>
        <dd>
          <input id="txtSiteUrl" name="txtSiteUrl" type="text" class="input txt" datatype="url" sucmsg=" " />
          <span class="Validform_checktip">*申请友情链接的网址</span>
        </dd>
      </dl>
      <dl>
        <dt>LOGO图片：</dt>
        <dd>
          <input id="txtImgUrl" name="txtImgUrl" type="text" class="input txt" />
          <span class="Validform_checktip">网站链接的LOGO图片地址</span>
        </dd>
      </dl>
      <dl>
        <dt>验证码：</dt>
        <dd>
          <input id="txtCode" name="txtCode" type="text" class="input small" datatype="*" sucmsg=" " />
          <a href="javascript:;" onclick="ToggleCode(this, '@(config.webpath)tools/verify_code.ashx');return false;">
            <img src="@(config.webpath)tools/verify_code.ashx" width="80" height="22" align="absmiddle" /> 看不清楚？
          </a>
          <span class="Validform_checktip"></span>
        </dd>
      </dl>
      <dl>
        <dt></dt>
        <dd>
          <input id="btnSubmit" name="btnSubmit" type="submit" value="申请链接" class="btn" />
        </dd>
      </dl>
    </div>
    </form>
    <!--/申请链接-->
  </div>
  <!--左边-->
</div>